package tea.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import stu.dao.StudentDaoImpl;
import tea.dao.teaDaoImpl;

/**
 * Servlet implementation class UpdateteaCourse
 */
@WebServlet("/UpdateteaCourse")
public class UpdateteaCourse extends HttpServlet {
private static final long serialVersionUID = 1L;      	

    public UpdateteaCourse() {
        super();
      
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");

		String classroom=request.getParameter("classroom");
		String cname=request.getParameter("cname");
		String cno=request.getParameter("cno");
		String date=request.getParameter("date");
		teaDaoImpl h1=new teaDaoImpl();		
		h1.updateTea(classroom,cname,cno,date);
		request.getRequestDispatcher("FindteaCourse").forward(request, response);
//	response.getWriter().write("<script>alert('�޸ĳɹ�!');window.location.href='TeacherIndex.jsp'</script>");
	}
	
	
	

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}